package cn.edu.zafu.bigdata.cdn;

import java.util.HashMap;
import java.util.Map;

public class StudentGradeManager {
    private Map<String, Integer> studentGrades;

    public StudentGradeManager() {
        studentGrades = new HashMap<>();
    }

    public void addStudent(String name, int grade) {
        studentGrades.put(name, grade);
    }

    public int getGrade(String name) {
        return studentGrades.getOrDefault(name, -1);
    }

    public void removeStudent(String name) {
        studentGrades.remove(name);
    }
    public static void main(String[] args) {
        StudentGradeManager manager = new StudentGradeManager();
        manager.addStudent("lihua", 90);
        manager.addStudent("wangwu", 85);
        manager.addStudent("zhaosi", 92);

        System.out.println("lihua's grade: " + manager.getGrade("lihua"));
        System.out.println("wangwu's grade: " + manager.getGrade("wangwu"));
        System.out.println("zhaosi's grade: " + manager.getGrade("zhaosi"));

        manager.removeStudent("wangwu");

        System.out.println("wangwu's grade after removal: " + manager.getGrade("wangwu"));
    }
}
 